SOURCE=main.cpp Ynbw.cpp Player.cpp YnbwException.cpp InternalDictionary.cpp runGame.cpp newGame.cpp
HEADERS=AppData.hpp Player.hpp YnbwException.hpp ExceptionNumbers.hpp std.hpp Ynbw.hpp InternalDictionary.cpp
EXE=ynbw3
DBG=ynbw3.dbg
INSTALLED=/usr/bin/$(EXE)
ARCHIVESRC=yesno_$(VERSION).tgz
ARCHIVEBIN=yesno_$(VERSION)_bin.tgz

all: ynbw3

ynbw3: $(SOURCE) $(HEADERS)
	@echo "===Building Y-N-B-W-II==="
	g++ -o $(EXE) $(SOURCE) -DVERSION=\"$(VERSION)\"

debug: $(SOURCE) $(HEADERS)
	@echo "===Building Y-N-B-W-II with Debugging==="
	g++ -o $(DBG) -DDEBUG -Wall -Werror -pedantic -g $(SOURCE)  -DVERSION=\"$(VERSION)\"

clean:
	@echo "===Cleaning up==="
	-rm $(EXE) $(DBG)
	-rm -r yesno/

install: ynbw3
	@echo "===Installing Y-N-B-W-II==="
	cp $(EXE) $(INSTALLED)

uninstall:
	-rm $(INSTALLED)

archive.src:
	@echo "===Archiving==="
	-mkdir ../questions-archives/
	-mkdir yesno
	cp *.cpp yesno
	cp *.hpp yesno
	cp Makefile yesno
	tar czvf $(ARCHIVESRC) yesno
	mv $(ARCHIVESRC) ../questions-archives/

archive.bin:
	@echo "===Archiving Binary=="
	-mkdir ../questions-archives/
	-mkdir yesno-bin
	cp ynbw3 yesno-bin
	cp ynbw3.dbg yesno-bin
	tar czvf $(ARCHIVEBIN) yesno.bin
	mv $(ARCHIVEBIN) ../questions-archives/

